<template>
  <div class="home">
    <el-form :inline="true" class="demo-form-inline">
          <el-form-item :label="$t('message.cgmc')+':'">
            <el-input
              v-model="$store.state.achievementsParams.releaseTitleCn"
              clearable
              :placeholder="$t('message.p-cgmc')"
              @input="changeStoreParams($event, 'releaseTitleCn')"
            ></el-input>
          </el-form-item>
          <el-form-item :label="$t('message.fbdw')+':'">
            <el-input
              v-model="$store.state.achievementsParams.releaseCom"
              clearable
              :placeholder="$t('message.p-fbdwmc')"
              @input="changeStoreParams($event, 'releaseCom')"
            ></el-input>
          </el-form-item>
          <el-form-item :label="$t('message.fbcj')+':'">
            <el-select
              v-model="$store.state.achievementsParams.releaseLevel"
              clearable
              :placeholder="$t('message.p-fbcj')"
              @change="changeStoreParams($event, 'releaseLevel')"
            >
              <el-option
                v-for="item in $store.state.releaseLevelList"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item :label="$t('message.cglx')+':'">
            <el-select
              v-model="$store.state.achievementsParams.releaseCode"
              clearable
              :placeholder="$t('message.qxzcglx')"
              @change="changeStoreParams($event, 'releaseCode')"
            >
              <el-option
                v-for="item in $store.state.achievementsTypeList"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item :label="$t('message.hyly')+':'" class="lang-item">
            <el-select
              v-model="$store.state.achievementsParams.releaseFieldOne"
              class="select-style"
              style="margin-right: 12px;"
              clearable
              :placeholder="$t('message.p-qxz')"
              @change="changeService({
                            value: $event,
                            level: 'releaseFieldOne',
                        })"
            >
              <el-option
                v-for="item in $store.state.releaseArea1"
                :key="item.dictCode"
                :label="item.dictName"
                :value="item.dictCode"
              ></el-option>
            </el-select>
            <el-select
              v-model="$store.state.achievementsParams.releaseFieldTwo"
              class="select-style"
              style="margin-right: 12px;"
              clearable
              :placeholder="$t('message.p-qxz')"
              @change="changeService({
                            value: $event,
                            level: 'releaseFieldTwo',
                        })"
            >
              <el-option
                v-for="item in $store.state.achievementsPage.releaseArea2"
                :key="item.dictCode"
                :label="item.dictName"
                :value="item.dictCode"
              ></el-option>
            </el-select>
            <el-select
              v-model="$store.state.achievementsParams.releaseFieldThree"
              class="select-style"
              clearable
              :placeholder="$t('message.p-qxz')"
              @change="changeService({
                            value: $event,
                            level: 'releaseFieldThree',
                        })"
            >
              <el-option
                v-for="item in $store.state.achievementsPage.releaseArea3"
                :key="item.dictCode"
                :label="item.dictName"
                :value="item.dictCode"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item :label="$t('message.sbsj')+':'" class="hack-width-auto">
            <el-date-picker
              v-model="$store.state.achievementsParams.releaseCreateTime"
              type="daterange"
              :range-separator="$t('message.to')"
              :start-placeholder="$t('message.p-starM')"
              :end-placeholder="$t('message.p-endM')"
              value-format="yyyy-MM-dd"
              @change="changeStoreParams($event, 'releaseCreateTime')"
            ></el-date-picker>
          </el-form-item>
          <el-form-item :label="$t('message.zt')+':'" class="lang-item1">
            <el-select
              v-model="$store.state.achievementsParams.contractStatus"
              class="select-style"
              style="margin-right: 12px;"
              clearable
              :placeholder="$t('message.p-qxz')"
              @change="changeStat"
            >
              <el-option
                v-for="item in $store.state.statType"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
            <el-select
              v-model="$store.state.achievementsParams.approvalStatus"
              class="select-style"
              style="margin-right: 12px;"
              clearable
              :placeholder="$t('message.p-qxz')"
              @change="changeStoreParams($event, 'approvalStatus')"
            >
              <el-option
                v-for="item in $store.state.statTypeDetail[$store.state.achievementsParams.contractStatus]"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item :label="$t('message.fbsj')+':'" class="hack-width-auto">
            <el-date-picker
              v-model="$store.state.achievementsParams.releaseTime"
              type="daterange"
              :range-separator="$t('message.to')"
              :start-placeholder="$t('message.p-starM')"
              :end-placeholder="$t('message.p-endM')"
              value-format="yyyy-MM-dd"
              @change="changeStoreParams($event, 'releaseTime')"
            ></el-date-picker>
          </el-form-item>
          <el-form-item :label="$t('message.fbdq')+':'">
            <el-select
              v-model="$store.state.achievementsParams.border"
              @change="changeStoreParams({
                            border: $event,
                            province: '',
                            cityCode: '',
                        })"
              class="select-style"
              style="margin-right: 10px;"
              clearable
              :placeholder="$t('message.p-qxz')"
            >
              <el-option
                v-for="item in $store.state.regionType"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
            <el-select
              v-model="$store.state.achievementsParams.province"
              v-if="$store.state.achievementsParams.border === 'within'"
              class="select-style"
              style="margin-right: 10px;"
              clearable
              :placeholder="$t('message.p-qxz')"
              @change="changProvince"
            >
              <el-option
                v-for="item in $store.state.provinceList"
                :key="item.code"
                :label="item.province"
                :value="item.code"
              ></el-option>
            </el-select>
            <el-select
              v-model="$store.state.achievementsParams.cityCode"
              v-if="$store.state.achievementsParams.border === 'within'"
              class="select-style"
              style="margin-right: 10px;"
              clearable
              :placeholder="$t('message.p-qxz')"
              @change="changeStoreParams({
                            cityCode: $event,
                        })"
            >
              <el-option
                v-for="item in $store.state.achievementsPage.subordinateProvinceList"
                :key="item.code"
                :label="item.province"
                :value="item.code"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item
            label-width="220px"
            v-if="$store.state.achievementsParams.border === 'overseas'"
            :label="$t('message.zfqysd')+':'"
            class="lang-item"
          >
            <!-- 中方企业属地 -->
            <el-select
              v-model="attributionProvince"
              class="select-style"
              style="margin-right: 10px;"
              clearable
              v-if="$store.state.achievementsParams.border === 'overseas'"
              :placeholder="$t('message.p-qxz')"
              @change="attributionChangProvince"
            >
              <el-option
                v-for="item in provinceAllList"
                :key="item.code"
                :label="item.province"
                :value="item.code"
              ></el-option>
            </el-select>
            <el-select
              v-model="attributionCityCode"
              class="select-style"
              style="margin-right: 10px;"
              clearable
			  @change="attributionChangCity"
              :placeholder="$t('message.p-qxz')"
            >
              <el-option
                v-for="item in cityList"
                :key="item.code"
                :label="item.province"
                :value="item.code"
              ></el-option>
            </el-select>
          </el-form-item>
    </el-form>
    <div class="search-bnt">
      <el-button class="reset" type="primary" 
      clstag="pageclick|keycount|result_achieve_manage|achieve_manage_screen_click"
      @click="searchList">{{$t('message.cx')}}</el-button>
      <el-button @click="reset" class="reset">{{$t('message.cz')}}</el-button>
      <el-button
        @click="exportExcel"
        :disabled="flag"
        class="reset"
        v-show="$store.state.UserIn!=='enterprise'"
      >{{$t('message.export')}}</el-button>
    </div>
    <!--
        <div class="edit-bnt">
             <el-button type="primary" @click="linkTo({ state:'bulid' }, 'achAdd')">新建成果项目统计表</el-button>
        </div>
    -->
    <!-- 表格 -->
    <el-table
      :data="tableData"
      v-loading="loading"
      class="table"
      border
      style="width: 100%;margin: 20px 0;"
      :header-cell-style="{background:'#eef1f6',color:'#606266'}"
    >
      <!-- empty-text="暂无数据" -->
      >
      <el-table-column
        :label="$t('message.xh')"
        :empty-text="$t('message.zwsj')"
        show-overflow-tooltip
        align="center"
        min-width="60"
      >
        <template scope="scope">
          <span>{{scope.$index + 1}}</span>
        </template>
      </el-table-column>
      <el-table-column
        prop="releaseTitleCn"
        :label="$t('message.cgmc')"
        :empty-text="$t('message.zwsj')"
        show-overflow-tooltip
        align="center"
        min-width="90"
      >
        <template slot-scope="scope">
          <span
            style="color: #238bc5; cursor: pointer"
            type="text"
            @click="details(scope.row.id, scope.row.auditClassification)"
          >{{scope.row.releaseTitleCn}}</span>
        </template>
      </el-table-column>
      <el-table-column
        prop="releaseCom"
        :label="$t('message.fbdw')"
        show-overflow-tooltip
        :empty-text="$t('message.zwsj')"
        align="center"
        min-width="90"
      ></el-table-column>
      <el-table-column
        prop="releaseCreateTime"
        :label="$t('message.sbsj')"
        show-overflow-tooltip
        :empty-text="$t('message.zwsj')"
        align="center"
        min-width="90"
      ></el-table-column>
      <el-table-column
        prop="releaseTime"
        :label="$t('message.fbrq')"
        show-overflow-tooltip
        :empty-text="$t('message.zwsj')"
        align="center"
        min-width="90"
      ></el-table-column>
      <el-table-column
        prop="releaseName"
        :label="$t('message.cglx')"
        show-overflow-tooltip
        :empty-text="$t('message.zwsj')"
        align="center"
        min-width="90"
      ></el-table-column>
      <el-table-column
        :label="$t('message.hyly')"
        show-overflow-tooltip
        :empty-text="$t('message.zwsj')"
        align="center"
        min-width="90"
      >
        <template slot-scope="scope">
          <span v-if="scope.row.releaseFieldOneName!==null">
            {{scope.row.releaseFieldOneName}}
            {{scope.row.releaseFieldTwoName | delNull}} {{scope.row.releaseFieldThreeName | delNull}}
          </span>
        </template>
      </el-table-column>
      <el-table-column :label="$t('message.zt')" align="center" min-width="90">
        <template slot-scope="scope">
          <p
            style="color: #238bc5; cursor: pointer"
            @click="checkReview(scope.row.id, scope.row.auditClassification)"
          >{{scope.row.approvalStatusCN}}</p>
        </template>
      </el-table-column>
      <el-table-column
        prop="approvalTime"
        :label="$t('message.shsj')"
        show-overflow-tooltip
        :empty-text="$t('message.zwsj')"
        align="center"
        min-width="90"
      ></el-table-column>
      <el-table-column :label="$t('message.caozuo')" fixed="right" align="center" min-width="145">
        <template scope="scope">
          <el-button
            v-if="scope.row.operate && scope.row.operate.del"
            type="text"
            @click="del(scope.row.id)"
          >{{$t('message.sc')}}</el-button>
          <el-button
            v-if="scope.row.operate && scope.row.operate.edit"
            type="text"
            @click="linkTo({ id: scope.row.id,state:'edit' }, 'achAdd')"
          >{{$t('message.bj')}}</el-button>
          <el-button
            v-if="scope.row.operate && scope.row.operate.track"
            type="text"
            @click="linkTo({ id: scope.row.id }, 'achTrackAdd')"
          >{{$t('message.czzz')}}</el-button>
          <el-button
            v-if="scope.row.operate && scope.row.operate.trackEdit"
            type="text"
            @click="linkTo({ id: scope.row.id }, 'achTrackAdd')"
          >{{$t('message.czbj')}}</el-button>
          <el-button
            v-if="scope.row.operate && scope.row.operate.approve"
            type="text"
            @click="linkTo({ id: scope.row.id }, 'achReview')"
          >{{$t('message.bnt-sh')}}</el-button>
          <el-button
            v-if="scope.row.operate && scope.row.operate.trackingApproval"
            type="text"
            @click="linkTo({ id: scope.row.id }, 'achReviewTrack')"
          >{{$t('message.czsh')}}</el-button>
          <el-button
            type="text"
            class="achDetails"
            @click="details(scope.row.id, scope.row.auditClassification)"
          >{{$t('message.cksbxq')}}</el-button>
          <el-button
            v-if="scope.row.operate && scope.row.operate.reApproval"
            type="text"
            @click="revoke(scope.row.id, scope.row.auditClassification)"
          >{{$t('message.qx')}}</el-button>
        </template>
      </el-table-column>
    </el-table>
    <div class="Pagiƒtion" style="text-align: right;margin-top: 10px;" v-show="count > 0">
      <div class="pagebox">
        <el-pagination
          layout="total, sizes, prev, pager, next, jumper"
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :total="count"
          :page-sizes="[5, 10, 20, 30, 40]"
          :page-size="$store.state.achievementsParams.pageSize || 10"
          :current-page="$store.state.achievementsParams.pageNo || 1"
        ></el-pagination>
      </div>
    </div>
    <el-dialog :title="reviewModalTitle[showReview]" :visible.sync="showReview" width="800">
      <div v-if="showReview === '0'">
        <review-list :dataList="reviewDataList"></review-list>
      </div>
      <div v-if="showReview === '1'">
        <review-track-list :dataList="reviewTrackDataList"></review-track-list>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="showReview = false">{{$t('message.gb')}}</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import mixinPage from "@/mixins/elPaginationHandle";
import reviewList from "@components/reviewList.vue";
import reviewTrackList from "@components/reviewTrackList.vue";
import axios from "axios";
import buried from "@/utils/buried";
export default {
  data() {
    return {
      count: 0, // 数据总条数
      loading: false,
      tableData: [],
      showReview: false, // 审核记录、追踪审核记录
      reviewModalTitle: [this.$t("message.shjl"), this.$t("message.zzshjl")],
      reviewDataList: [], // 审核记录
      reviewTrackDataList: [], // 追踪审核记录
      attributionProvince: "",
      attributionCityCode: "",
      provinceAllList: [],
      cityList: [],
      flag: false
    };
  },
  mixins: [mixinPage],
  watch: {
    provinceAllList2: function(val) {
      this.provinceAllList = val;
    }
  },
  computed: {
    provinceAllList2() {
      return this.$store.state.provinceAllList;
    }
  },
  components: {
    reviewList,
    reviewTrackList
  },
  filters: {
    delNull(str) {
      if (str == null) {
        str = "";
      } else {
        str = "-" + str;
      }
      return str;
    }
  },
  mounted() {
    this.query({
      pageNo: 1
    });
    this.provinceAllList = this.$store.state.provinceAllList;
	this.attributionProvince = this.$store.state.achievementsParams.attributionProvince
	let attributionCityCode = this.$store.state.achievementsParams.attributionCityCode
	this.attributionChangProvince(this.attributionProvince)
    this.attributionChangCity(attributionCityCode)
    buried("result_achieve_manage", "achieve_manage_pv");
  },
  methods: {
    //境外选择省市
    attributionChangProvince(value) {
	  const source = {
	  		  attributionProvince: value,
	  		  attributionCityCode: ""
	  		};
	  this.$store.commit("changeachievementsParams", source);	
      let indexTab;
      this.cityList = [];
      this.attributionCityCode = "";
      this.provinceAllList.forEach((item, index) => {
        if (item.code == value) {
          indexTab = index;
        }
      });
      if (
        this.provinceAllList[indexTab] &&
        this.provinceAllList[indexTab].subordinateProvinceList.length !== 0
      ) {
        this.provinceAllList[indexTab].subordinateProvinceList.forEach(item => {
          this.cityList.push(item);
        });
      }
    },
	attributionChangCity(value){
		const source = {
				  attributionCityCode: value
				};
		this.attributionCityCode = value		
		this.$store.commit("changeachievementsParams", source);
	},
    changProvince(evt) {
      evt = String(evt);
      const source = {
        province: evt,
        cityCode: ""
      };
      // 更新城市列表
      const list = {
        subordinateProvinceList:
          this.$store.state.provinceAllList.find(item => item.code === evt)
            .subordinateProvinceList || []
      };

      this.$store.commit("changeachievementsParams", source);
      this.$store.commit("changeachievementsPage", list);
    },
    changeService(params) {
      let source = {};
      let list = {};
      if (params.level === "releaseFieldOne") {
        source = {
          releaseFieldOne: params.value,
          releaseFieldTwo: "",
          releaseFieldThree: ""
        };

        list = {
          releaseArea2:
            (this.$store.state.releaseArea.find(
              item => item.dictCode === params.value
            ) || {}).serviceList || [],
          releaseArea3: []
        };
      } else if (params.level === "releaseFieldTwo") {
        source = {
          releaseFieldTwo: params.value,
          releaseFieldThree: ""
        };
        list = {
          releaseArea3:
            (this.$store.state.achievementsPage.releaseArea2.find(
              item => item.dictCode === params.value
            ) || {}).serviceList || []
        };
      } else {
        source = {
          releaseFieldThree: params.value
        };
      }

      this.$store.commit("changeachievementsParams", source);
      this.$store.commit("changeachievementsPage", list);
    },
    changeStat(evt) {
      this.changeStoreParams({
        contractStatus: evt,
        approvalStatus: ""
      });
    },
    exportExcel() {
      //导出excel
      this.flag = true;
      setTimeout(() => {
        this.flag = false;
      }, 3000);
      const prepareParams = {
        ...this.$store.state.achievementsParams // store中的参数
      };

      // 发布时间 格式处理
      if (prepareParams.releaseTime && prepareParams.releaseTime[1]) {
        prepareParams.releaseStartTime = prepareParams.releaseTime[0];
        prepareParams.releaseEndTime = prepareParams.releaseTime[1];
      }
      // 上报时间 格式处理
      if (
        prepareParams.releaseCreateTime &&
        prepareParams.releaseCreateTime[1]
      ) {
        prepareParams.releaseStartCreateTime =
          prepareParams.releaseCreateTime[0];
        prepareParams.releaseEndCreateTime = prepareParams.releaseCreateTime[1];
      }
      // 去除参数中的多余字段
      delete prepareParams.releaseCreateTime;
      delete prepareParams.releaseTime;
      console.log({ ...prepareParams });
      axios({
        method: "post",
        url: "/api/poi/exportReleaseListExcel", // 请求地址
        data: {
          ...prepareParams,
          attributionProvince: this.attributionProvince,
          attributionCityCode: this.attributionCityCode
        },
        responseType: "blob",
        observe: "response"
      })
        .then(res => {
          // fileName = "区科委补贴资源汇总.xls";
          console.log(res.headers);
          const tabA = document.createElement("a");
          let blob = new Blob([res], {
            type: "application/vnd.ms-excel"
          });
          console.log(blob);
          tabA.setAttribute("href", window.URL.createObjectURL(blob));
          tabA.setAttribute("download", "发布成果数据统计.xlsx");
          document.body.appendChild(tabA);
          tabA.click();
          document.body.removeChild(tabA);
        })
        .catch(err => {
          console.log(err);
        });
    },
    // 改非params字段
    changeStorePage(params = {}) {
      this.$store.commit("changeachievementsPage", params);
    },
    // 统一更新params更新到store
    changeStoreParams(params = {}, key = "") {
      if (this.$store.state.achievementsParams.border === "within") {
        this.attributionCityCode = "";
        this.attributionProvince = "";
		this.$store.commit("changeachievementsParams", {
					 attributionCityCode:'',
					 attributionProvince:''
		})
      }
	  if(params.border==''){
		 this.attributionCityCode = "";
		 this.attributionProvince = ""; 
		 this.$store.commit("changeachievementsParams", {
			 attributionCityCode:'',
			 attributionProvince:''
		 })
	  }
      let source = {};
      // 有key说明是单改某一个值 - filtr
      if (key) {
        source = {
          [key]: params
        };
      } else {
        source = params;
      }

      console.log(params, key);

      this.$store.commit("changeachievementsParams", source);
    },
    // // 校验
    // validate(params) {
    //     let rst = true
    //     return rst
    // },
    query(params = {}) {
      this.changeStoreParams(params);
      const prepareParams = {
        ...this.$store.state.achievementsParams // store中的参数
      };
      // 发布时间 格式处理
      if (prepareParams.releaseTime && prepareParams.releaseTime[1]) {
        prepareParams.releaseStartTime = prepareParams.releaseTime[0];
        prepareParams.releaseEndTime = prepareParams.releaseTime[1];
      }
      // 上报时间 格式处理
      if (
        prepareParams.releaseCreateTime &&
        prepareParams.releaseCreateTime[1]
      ) {
        prepareParams.releaseStartCreateTime =
          prepareParams.releaseCreateTime[0];
        prepareParams.releaseEndCreateTime = prepareParams.releaseCreateTime[1];
      }
      // 去除参数中的多余字段
      delete prepareParams.releaseCreateTime;
      delete prepareParams.releaseTime;

      // 校验
      // if (!this.validate(prepareParams)) {
      //     return
      // }

      this.$axios
        .post("/api/releaseResult/pageListReleaseResults", {
          ...prepareParams,
          ...params
        })
        //成功返回
        .then(res => {
          if (res.code === 200) {
            // 表格数据
            this.tableData = res.data || [];
            this.count = res.count || 0;
          } else {
            // 失败
            this.$message.error(res.message);
          }
        })
        //失败返回
        .catch(error => {
          console.log(error);
        });
    },
    handleCurrentChange(evt) {
      this.query({
        pageNo: evt
      });
    },
    handleSizeChange(evt) {
      this.query({
        pageSize: evt
      });
    },
    details(id, stat) {
      this.$router.push({
        path: "/details",
        query: {
          id,
          stat
        }
      });
    },
    // editContract(id){
    //     this.$router.push({
    //         path:'/details',
    //         query:{
    //             id:id,
    //             state:'edit'
    //         }
    //     })
    // },
    goPush() {
      // this.$router.push('/achievementrelease')
    },
    editTable() {
      // this.$router.push('/contractstatistics')
    },
    reset() {
      // 重置
      this.$store.commit("changeachievementsParams", {
        approvalStatus: "", // 审核状态
        contractStatus: "", // 状态一级
		attributionProvince:'',
		attributionCityCode:'',
        releaseLevel: "", // 发布等级
        border: "", // 境内外
        releaseCode: "", // 成果类型
        province: "", // 省份
        cityCode: "", // 市区
        releaseTime: "", // 发布时间
        releaseCreateTime: "", // 上报时间
        releaseCom: "", // 发布单位名称
        releaseTitleCn: "", // 成果中文名称
        releaseFieldOne: "", // 一级领域
        releaseFieldTwo: "", // 二级领域
        releaseFieldThree: "", // 三级领域
        pageSize: 10, //
        pageNo: 1 //
      });
      this.attributionProvince = "";
      this.attributionCityCode = "";
    },
    // 操作项的跳转
    linkTo(query = {}, target) {
      this.$router.push({
        path: `/${target}`,
        query
      });
    },
    // 查看审核记录
    checkReview(id, statType) {
      let url = "";
      let rstKey = "";
      // 普通审核
      if (statType === "0") {
        url = "/api/releaseResultLog/getRecords";
        rstKey = "reviewDataList";
      } else if (statType === "1") {
        // 追踪审核
        url = "/api/releaseResultTrack/getRecords";
        rstKey = "reviewTrackDataList";
      }

      this.$axios
        .get(url, {
          params: {
            id
          }
        })
        .then(res => {
          if (res.code === 200) {
            this.showReview = statType;
            // 表格数据
            this[rstKey] = res.data;
          } else {
            // 失败
            this.$message.error(res.message);
          }
        });
    },
    revoke(id, statType) {
      this.$confirm(this.$t("message.p-sfqx"), this.$t("message.ts"), {
        confirmButtonText: this.$t("message.ture"),
        cancelButtonText: this.$t("message.false"),
        type: "warning"
      }).then(res => {
        // 审核通过 - 重新审核
        this.$axios
          .get("/api/releaseResult/revokeApproval", {
            params: {
              businessId: id,
              businessType: ["RELSULT", "RELSULT_TRACK"][statType]
            }
          })
          .then(res => {
            if (res.code === 200) {
              this.$message({
                message: this.$t("message.qxcg"),
                type: "success"
              });
              this.query({
                pageNo: 1
              });
            } else {
              // 失败
              this.$message.error(res.message);
            }
          });
      });
    },
    del(id) {
      //删除
      this.$confirm(this.$t("message.p-sfsccgtj"), this.$t("message.ts"), {
        confirmButtonText: this.$t("message.ture"),
        cancelButtonText: this.$t("message.false"),
        type: "warning"
      }).then(res => {
        this.$axios
          .get("/api/releaseResult/deleteReleaseResult", {
            params: {
              id
            }
          })
          .then(res => {
            if (res.code === 200) {
              // 表格数据
              this.searchList();

              // 失败
              this.$message({
                message: this.$t("message.sccg"),
                type: "success"
              });
            } else {
              // 失败
              this.$message.error(this.$t("message.scsb"));
            }
          });
      });
    },
    searchList() {
      this.query({
        pageNo: 1
      });
    }
  }
};
</script>

<style lang="scss" scoped>
.home {
  background: #fff;
  width: 100%;
  padding: 20px;
}

// .el-form-item {
//   width: 350px;
// }

.el-form-item {
  ::v-deep .el-form-item__label {
    text-align: right;
    min-width: 130px;
  }

  ::v-deep .el-select {
    // width: 208px;
  }

  ::v-deep .el-date-editor--datetimerange {
    width: 200px;
  }

  ::v-deep .el-input {
    width: 208px;
  }
}

.select-style {
  ::v-deep .el-input {
    width: 120px;
  }
}
.achDetails {
  margin-left: inherit;
}
.search-bnt {
  margin-top: 28px;
  text-align: center;
}

.reset {
  margin: 0 10px;
  width: 88px;
}
.edit-bnt {
  margin-top: 30px;
  text-align: right;
}

.el-col {
  width: auto;
  // margin:5px 10px 0 0px;
}

.lang-item {
  width: 540px !important;
}
.lang-item1 {
  width: 400px !important;
}
.table {
  ::v-deep .cell {
    white-space: inherit !important;
    word-break: inherit !important;
  }
}
.el-dialog__wrapper {
  ::v-deep .el-dialog__body {
    padding: 0 20px !important;
  }
}
.hack-width-auto {
  width: auto !important;
}
.hack-width-auto {
  ::v-deep .el-date-editor--daterange.el-input__inner {
    width: 250px;
  }
}
</style>
